package com.jersey.webserver;

import com.jersey.vo.User;
import org.springframework.stereotype.Component;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

/**
 * Create by Vic Xu on 2018/8/2
 */
@Component
@Path("/hello")
public class WebserverController {

    @GET
    @Path("/get")
    @Produces(MediaType.APPLICATION_JSON)
    public User sayHelloToUserByJson(@QueryParam("name") String name) {
        User user = new User();
        user.setName(name);
        user.setAge(15);
        return user;
    }
}
